package com.rcloud.server.sealtalk.constant;

public enum ErrorCode {

    //common error
    COOKIE_ERROR(404, "Invalid cookie value!",404),
    SEND_SMS_ERROR(401, "Send sms error.",401),
    SERVER_ERROR(500, "Server error.",500),
    PARAM_ERROR(400, "Parameter error or empty,Please check.",400),
    YUN_PIAN_SMS_ERROR(3004, "您获取短信验证码次数频繁，请稍后重试！",3004),
    REQUEST_ERROR(400, "Request error.",400),
    ILLEGAL_PARAMETER(400,"Illegal parameter.",400),
    EMPTY_PARAMETER(400,"Parameter is empty.",400),
    PARAMETER_ERROR(400,"Parameter error.",400),

    EMPTY_STACCOUNT_LENGHT_ERROR(400,"Incorrect parameter length.",400),
    EMPTY_STACCOUNT_ERROR(400,"Not letter beginning or invalid symbol.",400),
    USER_STACCOUNT_EXIST(1000,"User stAccount already exists.",200),

    //send_code
    LIMIT_ERROR(5000, "Throttle limit exceeded.",200),
    INVALID_REGION_PHONE(400, "Invalid region and phone number.",400),

    //invoke rongcloud server error
    INVOKE_RONG_CLOUD_SERVER_ERROR(2000,"RongCloud Server API Error: ",2000),


    //verify_code error
    UNKOWN_PHONE_NUMBER(1000, "未知的手机号码！",200),
    VERIFY_CODE_EXPIRED(1000, "验证码已过期，请重新获取",200),
    INVALID_VERIFY_CODE(1000, "验证码不正确，请重新输入",200),

    //register error
    INVALID_PASSWORD(400, "Password must have no space.",400),
    INVALID_NICKNAME_LENGTH(400, "Length of nickname invalid.",400),
    INVALID_PASSWORD_LENGHT(400, "Length of password invalid.",400),
    INVALID_VERIFICATION_TOKEN(400, "Invalid verification_token.",400),
    UNKNOWN_VERIFICATION_TOKEN(404, "Unknown verification_token.",404),
    PHONE_ALREADY_REGISTERED(400, "the phone already registered.",400),

    //login error
    USER_NOT_EXIST(1000, "未查询到该用户信息.",200),
    USER_PASSWORD_WRONG(1001, "Wrong password.",200),
    USER_PASSWORD_WRONG_2(1000, "Wrong old password.",200),
    USER_NOT_AUTH_ERROR(1000, "用户未认证，请先去进行实名认证.",200),
    USER_NOT_PAY_ERROR(1000, "您还未支付认证费用，请先缴纳认证费后再次认证！",200),

    //user error
    INVALID_PORTRAITURI_FORMAT(400,"Invalid portraitUri format.",400),
    INVALID_PORTRAITURI_LENGTH(400,"Invalid portraitUri length.",400),
    FRIEND_USER_NOT_EXIST(404,"friendId is not an available userId.",404),
    UNKNOW_USER(404,"Unknown user.",404),
    INVALID_REGION_LIST(1000,"Invalid region list.",1000),
    INVALID_TIMESTAMP_VERSION(400,"Version parameter is not integer.",400),

    //misc error
    UNSUPPORTED_CONVERSATION_TYPE(403,"Unsupported conversation type.",403),
    NOT_YOUR_FRIEND(403,"User {} is not your friend.",403),
    NOT_YOUR_GROUP(403,"Your are not member of Group {} .",403),



    //friendShip error
    INVALID_INVITE_MESSAGE_LENGTH(400,"Length of friend request message is out of limit.",400),
    UNKNOW_FRIEND_USER_OR_INVALID_STATUS(404,"Unknown friend user or invalid status.",404),
    NOT_FRIEND_USER(403,"Current user is not friend of user",403),
    ALREADY_YOUR_FRIEND(400, "User + friendId  is already your friend.",400),
    EMPTY_ContactList(400, "Empty contactList.",400),


    //group error
    INVALID_GROUP_NAME_LENGTH(400,"Length of group name is out of limit.",400),
    INVALID_GROUP_MEMNBER_COUNT(400,"Group's member count should be greater than 1 at least.",400),
    INVALID_GROUP_MEMNBER_MAX_COUNT(400,"群组成员人数超出最大人数限制！",200),
    INVALID_USER_GROUP_COUNT_LIMIT(1000,"当前用户的群组数超出最大用户群组数！",200),
    INVALID_PARAM_CREATOR(400,"Creator is not in memeber list.",400),
    GROUP_LIMIT_ERROR(20002,"Creator is not in memeber list.",20002),
    GROUP_UNKNOWN_ERROR(404,"Unknown group.",404),
    NOT_GROUP_MANAGER(400,"Current user is not group manager.",400),
    NOT_GROUP_MEMBER(400,"Not a group member",400),
    NOT_GROUP_OWNER(400,"Not a group owner .",400),
    NO_PERMISSION(20001,"No permission",20001),
    NOT_GROUP_MEMBER_2(403,"Only group member can get group member info.",403),
    INVALID_DISPLAY_NAME_LENGTH(400,"Length of display name invalid.",400),
    INVALID_GROUP_PORTRAITURI_LENGTH(400,"Length of portraitUri invalid.",400),
    GROUP_OR_CREATOR_UNKNOW(400,"Unknown group or not creator.",400),
    NO_GROUP_BULLETIN(402,"No group bulletin.",402),
    INVALID_GROUP_BULLETIN(400,"Length of bulletin invalid.",400),
    ALREADY_EXISTS_GROUP(405,"Group already exists.",405),
    TRANSFER_TO_CREATOR_ERROR(403,"Can not transfer creator role to yourself.",403),
    INVALID_GROUPID_USERID(400,"Invalid groupId or userId.",400),
    NOT_GROUP_CREATOR(400,"Current user is not group creator.",400),
    QUIT_IM_SERVER_ERROR(500,"Quit failed on IM server.",500),
    NOT_GROUP_MEMBER_3(403,"Current user is not group member.",403),
    NOT_GROUP_MANAGER_3(403,"Current user is not group manager.",403),
    CAN_NOT_KICK_YOURSELF(400,"Can not kick yourself.",400),
    CAN_NOT_KICK_CREATOR(405,"Can not kick the host.",405),
    GROUP_MEMBER_EMPTY(500,"Group member should not be empty, please check your database.",500),
    EMPTY_MEMBERID(400,"Empty memberId.",400),
    CANT_NOT_KICK_NONE_MEMBER(400,"Can not kick none-member from the group.",400),
    NOT_IN_GROUP(403,"Not in the group.",403),
    NO_PERMISSION_SET_MANAGER(401,"No permission to set up an manager.",401),
    INVALID_OPERATION_SET_MANAGER(401,"Param error.",401),
    CAN_NOT_SET_CREATOR(403,"Cannot set the group creator.",403),
    NO_GROUP(20006,"No Group",200),
    IN_PROTECTED_GROUP(20004,"Protected",200),
    COPIED_GROUP(20005,"Copied",200),
    MEMBER_LIMIT(20007,"Member Limit",200),
    NOT_FOUND(20003,"Not found",200),
    EMPTY_GROUPID(400,"Empty groupId.",200),
    GROUPID_NULL(500,"groupId cannot be null.",500),
    MemberProtection_NULL(500,"memberProtection cannot be null.",500),
    STATUS_NULL(500,"status cannot be null.",500),

    NOT_FIND_USER_ERROR(2000, "查无此人！",200),

    //yunpian error 云片服务错误，错误码3000 开头
    YP_SERVER_FAILD(3000, "YunPian server error",3000),
    YP_GET_TEMPLATE_FAILD(3001, "Failed to get YunPian template",3001),
    YP_TEMPLATE_EMPTY(3002, "YunPian SMS template is empty",3002),
    YP_SEND_VERIFYCODER_FAILD(3003, "Send YunPian SMS code failed",3003),
    YP_SNED_TIMES_VIOLATION(3004, "Too many times sent",3004),
    //收藏模块的错误代码
    BUSI_USER_COLLECT_QUERY_ERROR(4001, "未查询到该收藏信息",200),
    BUSI_SET_USER_COLLECT_NOT_SUPPORT_ERROR(4002, "该收藏类型不支持设置常用语",200),
    //快递模块的错误代码
    EXPRESS_QUERY_ERROR(5001, "未查询到快递信息",200),
    QRCODE_QUERY_ERROR(5002, "未识别到条码信息",200),
    //支付模块的错误代码
    PAY_INFO_ERROR(6001, "支付查询出现错误",200),
    PAY_ORDER_NOT_EXIT_ERROR(6002, "该订单不存在",200),
    PAY_ORDER_ALREADY_PAY_ERROR(6003, "订单已支付",200),
    PAY_ORDER_ALREADY_UPDATE_ERROR(6004, "订单信息已更改",200),
    NO_BUSI_TYPE(6005, "未查询到该业务类型",200),

    FACE_AUTH_FAIL_ERROR(7000, "人脸识别认证失败",200),
    FACE_REQ_FAIL_ERROR(7001, "人脸识别接口请求失败",200),

    IDENTIFY_CARD_ERROR(8000, "未识别出身份证信息,请重新尝试！",200),
    IDENTIFY_AUTH_ERROR(8001, "实名认证失败",200),
    //企业模块信息
    COMPANY_QUERY_ERROR(9000, "未查询到该企业信息",200),
    SOCIAL_NUM_NOT_SAME_ERROR(9000, "社会统一编码不一致，验证失败",200),
    FRDB_NOT_SAME_ERROR(9000, "法定代表人信息不一致，验证失败",200),
    //商户信息
    USER_IS_NOT_AUTH_MERCHANT_ERROR(9100, "用户不是认证商户",200),
    QUERY_COMPANY_INFO_ERROR(9200, "未查询到该企业信息",200),
    MERCHANT_IS_AUTH_ERROR(9300, "该用户已是认证成商户,无需重复认证！",200),
    TOBACCO_DOC_NOT_UPLOAD_ERROR(9400, "烟草资料未提交,无法进行查询，请先补充资料，再次验证！",200),

    CAN_NOT_CREATE_GROUP_ERROR(19500, "群主或者群成员中有未认证用户,建群失败,请认证后重试!",200),
    CAN_NOT_JOIN_GROUP_ERROR(19500, "您不是认证商户,进群失败,请认证成商户后重试!",200),
    CAN_NOT_REPEAT_JOIN_GROUP_ERROR(19600, "您已经是群组成员无需重复申请！",200),

    //朋友圈信息
    NOT_QUERY_MOMENTS_INFO(21000, "未查询到该朋友圈信息.",200),
    CAN_NOT_REMOVE_OTHER_MOMENTS_INFO(21100, "只能删除自己的朋友圈信息.",200),
    WECHAT_PARAMS_NOT_EMPTY(400, "参数不能同时为空",200),
    TENCENT_USERID_NOT_EMPTY(400, "请上传用户标识 userId的信息",200),
    //广告信息
    NOT_QUERY_ADVERTISEMENT_INFO(31000, "未查询到该广告信息或者广告信息未显示",200),
    CAN_NOT_REMOVE_OTHER_ADVERTISEMENT_INFO(31100, "只能删除自己的广告信息.",200),
    ADVERTISEMENT_PARAMS_NOT_EMPTY(400, "参数不能同时为空",200),
    AVAILABLE_TIME_NOT_ENOUGH(31200, "广告发布条数已达上限",200),
    REFRESH_TIME_NOT_ENOUGH(31300, "广告刷新次数已达上限",200),
    EDIT_TIME_NOT_ENOUGH(31400, "广告编辑次数已达上限",200),
    CAT_NOT_EDIT_OTHER_INFO(31500, "无法编辑他人广告信息",200),
    NOT_AUTH_QUERY_AD(31600, "您不是认证用户，无法查询，请先进行商户认证！",200),
    JWT_AUTH_TOKEN_ERROR(31700, "token认证失败！",200),
    CAN_NOT_QUERY_RECOMMEND_USER(31800, "未查询到该推荐人信息！",200),
    BLOCK_USER_CAN_NOT_SEND_MSG(31900, "您已被封禁，无法获取验证码!",200);


    private int errorCode;
    private String errorMessage;
    private int httpStatusCode;

    ErrorCode(int errorCode, String errorMessage,int httpStatusCode) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
        this.httpStatusCode = httpStatusCode;

    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public int getHttpStatusCode() {
        return httpStatusCode;
    }

    public void setHttpStatusCode(int httpStatusCode) {
        this.httpStatusCode = httpStatusCode;
    }
}
